<?php 
session_start();
if(isset($_SESSION['access'])){
$page = ($_SESSION['access'] == 0) ? 'studentmasterpage.php' : 'facultymasterpage.php';
include $page;
}
else{
echo $_SESSION['name'];
echo $_SESSION['access'];
echo "the session isnt working";
}
?>
<head>
	<title>Course List</title>
</head>

<h1>Course List</h1>

<body>

<p>
These are the courses available to schedule.   </br>

</p>



<?php
   require 'dbconnect.php';
   
$sqlCheck = "Select * From Course";

   
$result = mysql_query("SELECT * FROM Course");
echo "<table border='5'>
<tr>
<th>Courses</th>
<th>CourseID</th>
<th>SectionNumber</th>
<th>Prerequisite</th>
</tr>";

while($row = mysql_fetch_array($result)){

       echo "<tr>";
 echo "<td>" . $row['CourseName'] . "</td>";
 echo "<td>" . $row['CourseID'] . "</td>";
 echo "<td>" . $row['SectionNo'] . "</td>";
 echo "<td>" . $row['Prerequisite'] . "</td>";

 echo "</tr>";
   }
echo "</table>";

include 'footer.php';

?>




